set -evx

export LD_LIBRARY_PATH=$(readlink -f $(pwd)/openssl)
export openssl=./openssl/apps/openssl

# diff:

    # rsa:
        $openssl genrsa -out rsakey.pem 2048
        $openssl pkey -in rsakey.pem -outform DER -out rsakey.der1
        $openssl base64 -d -in rsakey.pem -out rsakey.der2

    # sm2:
        $openssl ecparam -name SM2 -genkey -noout -out sm2key.pem
        $openssl pkey -in sm2key.pem -outform DER -out sm2key.der1
        $openssl base64 -d -in sm2key.pem -out sm2key.der2

# same:

    # ec:
        $openssl ecparam -name prime256v1 -genkey -noout -out eckey.pem
        $openssl pkey -in eckey.pem -outform DER -out eckey.der1
        $openssl base64 -d -in eckey.pem -out eckey.der2

    # dh:
        $openssl genpkey -genparam -algorithm DH -out dhp.pem
        $openssl genpkey -paramfile dhp.pem -out dhkey.pem
        $openssl pkey -inform pem -in dhkey.pem -outform DER -out dhkey.der1
        $openssl base64 -d -in dhkey.pem -out dhkey.der2

    # ed25519:
        $openssl genpkey -algorithm ed25519 -out ed25519key.pem
        $openssl pkey -in ed25519key.pem -outform DER -out ed25519key.der1
        $openssl base64 -d -in ed25519key.pem -out ed25519key.der2

    # x25519:
        $openssl genpkey -algorithm x25519 -out x25519key.pem
        $openssl pkey -in x25519key.pem -outform DER -out x25519key.der1
        $openssl base64 -d -in x25519key.pem -out x25519key.der2
